using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;

namespace Tool
{
    public partial class GlobalVariableTextInput : Form
    {
        DuplicateEventNameDlg duplicateDlg;
        
        public System.Windows.Forms.Form m_parent;

        public GlobalVariableTextInput(System.Windows.Forms.Form pForm)
        {
            InitializeComponent();
            m_parent = pForm;
            duplicateDlg = new DuplicateEventNameDlg();
        }

        public void ButtonOK_Click(object sender, EventArgs e)
        {
            if (GlobalVariableName.Text == "")
            {
                return;
            }

            ((Editor)m_parent).m_globalVarManager.AddGlobalVariable(GlobalVariableName.Text);
            this.Close();
        }

        private void InputText_Load(object sender, EventArgs e)
        {
            GlobalVariableName.Focus();
        }

        private void button2_Click(object sender, EventArgs e)
        {
            GlobalVariableName.Focus();
            GlobalVariableName.Clear();
        }
    }
}